package com.umbacos.udm.client.arch;

import java.util.Date;

import com.google.gwt.i18n.client.NumberFormat;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.user.client.Cookies;

public class Util {

	public final static String JSONNumberFormat(String key, JSONObject info) {
		return NumberFormat.getDecimalFormat().format(Double.parseDouble(info.get(key).toString()));
	}

	public final static String JSONEpocDateFormat(String key, JSONObject info) {
		return new Date(new Integer(new Integer(info.get(key).toString())*new Integer(1000))).toString();
	}
	
	public final static String getSavedValue(String key){
		String c= Cookies.getCookie(key);
		return c==null?"":c;
	}

	public final static void setSavedValue(String key, String value){
		Cookies.setCookie(key, value);
	}
}
